package com.sss.hloster0704;

public class TestEx08 {

	public static void main(String[] args) {
		Person p1 = new Person();
		Person p2 = new Person();
		try {
			p1.setAge(150);// 会抛出 AgeException 自定义异常
			System.out.println("正确输出年龄为：" + p1.getAge());
		} catch (AgeException e) {
			System.out.println(e.toString());
		}
		try {
			p2.setAge(60);// 不会抛出 AgeException 自定义异常
			System.out.println("正确输入年龄为：" + p2.getAge());
		} catch (AgeException e1) {
			System.out.println(e1.toString());
		}

	}

}
